<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.sql.*" %>
<%@page import="edu.upeu.lp1.common.Conexion" %>
<%
String go=request.getParameter("go");
if(go.equals("Create"))
        try {
            Conexion conn = new Conexion();
            
            String qry="insert into User(UserId,Name,Login,Password,ForcePasswordChange,Email,Privilege,ActiveAccount,DateCreate) values (?,?,?,?,?,?,?,?,?)";
            PreparedStatement ps=conn.getConnection().prepareStatement(qry);
            ps.setInt(1, Integer.parseInt(request.getParameter("UserId")));
            ps.setString(2, request.getParameter("Name"));
            ps.setString(3, request.getParameter("Login"));
            ps.setString(4, request.getParameter("Password"));
            ps.setString(5, request.getParameter("ForcePasswordChange"));
            ps.setString(6, request.getParameter("Email"));
            ps.setString(7, request.getParameter("Privilege"));
            ps.setString(8, request.getParameter("ActiveAccount"));
            ps.setString(9, request.getParameter("DateCreate"));
            int r=ps.executeUpdate();
            out.println(r+" registros agregados en la tabla User<br>");
            conn.close();
        } catch (Exception e) {
            out.print("Error: " +e.getMessage());
        }
if(go.equals("Edit"))
        try {
            Conexion conn = new Conexion();
      
            String qry="update User set "+
                    "Name=?, Login=?,Password=?,ForcePasswordChange=?,Email=?, Privilege=?,ActiveAccount=?,DateCreate=? "+
                    " where UserId=?";
            PreparedStatement ps=conn.getConnection().prepareStatement(qry);
            ps.setString(1, request.getParameter("Name") );
            ps.setString(2, request.getParameter("Login"));
            ps.setString(3, request.getParameter("Password") );
            ps.setString(4, request.getParameter("ForcePasswordChange") );
            ps.setString(3, request.getParameter("Email") );
            ps.setString(3, request.getParameter("Privilege") );
            ps.setString(3, request.getParameter("ActiveAccount") );
            ps.setString(3, request.getParameter("DateCreate") );
            ps.setString(3, request.getParameter("UserId") );
            int r=ps.executeUpdate();
            out.println(r+" registros edit in Curso table<br>");
            conn.close();
        } catch (Exception e) {
            out.print("Error: " +e.getMessage());
        }    
if(go.equals("Delete"))
        try {
            Conexion conn = new Conexion();
            
            String qry="delete from User where UserId=?";
            PreparedStatement ps=conn.getConnection().prepareStatement(qry);
            ps.setString(1, request.getParameter("UserId") );
            int r=ps.executeUpdate();
            out.println(r+" registros delete of Curso table<br>");
            conn.close();
        } catch (Exception e) {
            out.print("Error: " +e.getMessage());
        }  
%>
Espere...
<meta http-equiv="refresh" content="1;URL=UserMain.jsp" >